<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
    <title>Title</title>
</head>
<body>
<div id="pic">
    <p>等方式尽快靓女六点十分v看</p>
    <img style="width: 100px;height: 100px"
    src="">
    <button type="default" onclick="screen()">截图</button>
</div>
<script>
	function screen() {
		html2canvas(document.querySelector("#pic")).then(canvas => {
			let url = canvas.toDataURL("image/png", 1.0);
			console.log(url, "——————————————这是url——————————")
			document.body.appendChild(canvas)
			console.log(canvas, "——————————————这是canvas——————————")
		})
	}

</script>
</body>
</html>